#include "pch.h"
#include "seDialog.h"

void seDialog::Load()
{
	
	if (!mImageDialog.LoadFromFile("data/dialog.png")) printf("Blad przy ladowaniu dialog.png");
	if (!mFont.LoadFromFile("data/font.ttf")) printf("Blad przy ladowaniu font.ttf");
}

void seDialog::Unload()
{

}

void seDialog::Init()
{
	mSpriteDialog.SetImage(mImageDialog);	
	mSpriteDialog.SetPosition(viewWidth/2 - mImageDialog.GetWidth()/2, viewHeight/2 - mImageDialog.GetHeight()/2); // ustawiamy na srodku
	mTitle.SetText("Pusto tu");
	mTitle.SetFont(mFont);
	mTitle.SetSize(25);
	mTitle.SetColor(sf::Color(255, 255, 255));
	mTitle.SetPosition(viewWidth/2 - mImageDialog.GetWidth()/2 + 64, viewHeight/2 - mImageDialog.GetHeight()/2 + 64);
}

void seDialog::Step()
{

}

void seDialog::Draw()
{
	mSpriteDialog.SetPosition(viewWidth/2 - mImageDialog.GetWidth()/2, viewHeight/2 - mImageDialog.GetHeight()/2); // ustawiamy na srodku
	mTitle.SetPosition(viewWidth/2 - mImageDialog.GetWidth()/2 + 64, viewHeight/2 - mImageDialog.GetHeight()/2 + 64);
	app.Draw(mSpriteDialog);
	app.Draw(mTitle);
}

void seDialog::SetCurrentContent(std::string currentContent)
{
	mTitle.SetText(currentContent);
}
